//
//  SingleTest.m
//  Test
//
//  Created by jansh on 16/2/17.
//  Copyright © 2016年 jansh. All rights reserved.
//

#import "SingleTest.h"

@implementation SingleTest
+ (instancetype)sharedWithTest
{
    static SingleTest *manager = nil;
//    static dispatch_once_t onceToken;
//    dispatch_once(&onceToken, ^{
//        manager = [[[self class] alloc] init];
//    });
//    if (manager == nil) {
//        manager = [[SingleTest alloc] init];
//    }
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [[super allocWithZone:NULL] init];
    });
    return manager;
}

+ (id)copyWithZone:(struct _NSZone *)zone
{
    return [SingleTest sharedWithTest];
}

+ (id)allocWithZone:(struct _NSZone *)zone
{
    return [SingleTest sharedWithTest];
}

@end
